package io.github.uicdb.et.item.weapon;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import io.github.uicdb.et.ElementalTheory;
import mod.azure.azurelib.common.api.client.model.DefaultedItemGeoModel;
import mod.azure.azurelib.common.api.client.renderer.GeoItemRenderer;
import mod.azure.azurelib.common.internal.common.cache.object.GeoBone;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;

public class WaterStaffRenderer extends  GeoItemRenderer<WaterStaffItem>{
    public WaterStaffRenderer() {
        super(new DefaultedItemGeoModel<>(
            ResourceLocation.fromNamespaceAndPath(ElementalTheory.MODID,"water_source_staff")
        ));
    }

    @Override
    public void renderChildBones(PoseStack poseStack, WaterStaffItem animatable, GeoBone bone, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
        if((bone.getName().equals("water")||bone.getName().equals("water2"))&&!Minecraft.getInstance().player.getUseItem().getItem().equals(animatable))
            return;
        super.renderChildBones(poseStack, animatable, bone, renderType, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, red, green, blue, alpha);
    }
}
